<?php
/* xiuno语法将调用预定义前缀, 此处不应自定义前缀
 * 
 * 新建标签表 (tagid name)
 * 新建关联表 (tagid tid)
 * 缓存初始化 (锁权 敏感 字数)
 */
$tablepre = $db->tablepre;
$sql="CREATE TABLE IF NOT EXISTS `{$tablepre}git_tags` (
  `tagid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` char(32) NOT NULL,
  `link` int(10) NOT NULL,
  PRIMARY KEY (`tagid`),
  UNIQUE KEY `id` (`tagid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=63;";

db_exec($sql);


$sql="CREATE TABLE IF NOT EXISTS `{$tablepre}git_tags_thread` (
  `tagid` int(11) unsigned NOT NULL,
  `tid` int(11) unsigned NOT NULL
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;";
db_exec($sql);


$kv = kv_cache_get('git_tags');
if(!$kv) {
	$kv = array('lock'=>'1', 'stop'=>'商女不知亡国恨 隔江犹唱双截棍', 'limit'=>'24');
	kv_cache_set('git_tags', $kv);
}
?>